import 'package:C20Driver/pages/user_module/wallet/expenditure.dart';
import 'package:C20Driver/pages/user_module/wallet/income.dart';
import 'package:C20Driver/pages/user_module/wallet/whole.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class BillTabDetail extends StatefulWidget {
  @override
  _BillTabDetailState createState() => _BillTabDetailState();
}

class _BillTabDetailState extends State<BillTabDetail>
    with TickerProviderStateMixin {
  TabController _controller;

  @override
  void initState() {
    super.initState();
    _controller = TabController(length: 3, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('账单明细'),
        elevation: 0,
      ),
      body: Container(
        width: double.infinity,
        height: double.infinity,
        color: Color(0xffEFF3F9),
        child: Column(
          children: [
            Container(
              alignment: Alignment.topCenter,
              width: ScreenUtil().setWidth(750),
              height: ScreenUtil().setWidth(100),
              decoration: BoxDecoration(
                color: Color(0xffffffff),
              ),
              child: TabBar(
                controller: _controller,
                isScrollable: true,
                unselectedLabelColor: Color(0xff999999),
                labelColor: Color(0xff333333),
                indicatorColor: Color(0xff3FB956),
                // 选中
                indicatorSize: TabBarIndicatorSize.tab,
                // indicatorWeight: ScreenUtil().setWidth(8),
                indicator: UnderlineTabIndicator(
                  borderSide: BorderSide(
                      color: Color(0xff3FB956),
                      width: ScreenUtil().setWidth(8)),
                  insets: EdgeInsets.symmetric(horizontal: 45.0),
                ),
                tabs: [
                  Tab(
                    child: Container(
                      alignment: Alignment.center,
                      width: ScreenUtil().setWidth(150),
                      child: Text(
                        '全部',
                        style: TextStyle(
                          fontSize: ScreenUtil().setSp(32.0),
                          fontWeight: FontWeight.w500,
                        ),
                      ),
                    ),
                  ),
                  Tab(
                    child: Container(
                      alignment: Alignment.center,
                      width: ScreenUtil().setWidth(150),
                      child: Text(
                        '收入',
                        style: TextStyle(
                          fontSize: ScreenUtil().setSp(32.0),
                          fontWeight: FontWeight.w500,
                        ),
                      ),
                    ),
                  ),
                  Tab(
                    child: Container(
                      alignment: Alignment.center,
                      width: ScreenUtil().setWidth(150),
                      child: Text(
                        '支出',
                        style: TextStyle(
                          fontSize: ScreenUtil().setSp(32.0),
                          fontWeight: FontWeight.w500,
                        ),
                      ),
                    ),
                  )
                ],
              ),
            ),
            Expanded(
              child: TabBarView(
                children: <Widget>[
                  Expenditure(),
                  BillIncome(),
                  BillExpenditure(),
                ],
                controller: _controller,
              ),
            ),
          ],
        ),
      ),
    );
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }
}
